#ifndef __GLERROR_H
#define __GLERROR_H

#include <iostream>

void errorcheck(const char *filename, int line) {
	GLenum Error = glGetError();
	if (Error != GL_NO_ERROR) {
		std::cerr << "OpenGL Error!" << std::endl;
		std::cerr << "Error code: " << Error << std::endl;
		std::cerr << "File: " << filename << std::endl;
		std::cerr << "Line: " << line << std::endl;
		exit(-1);
	}
}

#endif
